package com.hjm.project.merchantInfo.total.service.impl;

import java.util.List;
import com.hjm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hjm.project.merchantInfo.total.mapper.MerchantTotalMapper;
import com.hjm.project.merchantInfo.total.domain.MerchantTotal;
import com.hjm.project.merchantInfo.total.service.IMerchantTotalService;
import com.hjm.common.utils.text.Convert;

/**
 * 商户信息统计Service业务层处理
 * 
 * @author LOVE
 * @date 2020-12-07
 */
@Service
public class MerchantTotalServiceImpl implements IMerchantTotalService 
{
    @Autowired
    private MerchantTotalMapper merchantTotalMapper;

    /**
     * 查询商户信息统计
     * 
     * @param id 商户信息统计ID
     * @return 商户信息统计
     */
    @Override
    public MerchantTotal selectMerchantTotalById(Long id)
    {
        return merchantTotalMapper.selectMerchantTotalById(id);
    }

    /**
     * 查询商户信息统计列表
     * 
     * @param merchantTotal 商户信息统计
     * @return 商户信息统计
     */
    @Override
    public List<MerchantTotal> selectMerchantTotalList(MerchantTotal merchantTotal)
    {
        return merchantTotalMapper.selectMerchantTotalList(merchantTotal);
    }

    /**
     * 新增商户信息统计
     * 
     * @param merchantTotal 商户信息统计
     * @return 结果
     */
    @Override
    public int insertMerchantTotal(MerchantTotal merchantTotal)
    {
        merchantTotal.setCreateTime(DateUtils.getNowDate());
        return merchantTotalMapper.insertMerchantTotal(merchantTotal);
    }

    /**
     * 修改商户信息统计
     * 
     * @param merchantTotal 商户信息统计
     * @return 结果
     */
    @Override
    public int updateMerchantTotal(MerchantTotal merchantTotal)
    {
        merchantTotal.setUpdateTime(DateUtils.getNowDate());
        return merchantTotalMapper.updateMerchantTotal(merchantTotal);
    }

    /**
     * 删除商户信息统计对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteMerchantTotalByIds(String ids)
    {
        return merchantTotalMapper.deleteMerchantTotalByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商户信息统计信息
     * 
     * @param id 商户信息统计ID
     * @return 结果
     */
    @Override
    public int deleteMerchantTotalById(Long id)
    {
        return merchantTotalMapper.deleteMerchantTotalById(id);
    }
}
